﻿using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;
namespace PlantsVsZombies
{
    public class Vehicle : Character
    {

        private Boolean _isMove;
        public Vehicle( Vector2 pos)
        {
            IsMove = false;
            NSprites = 1;
            this.Position = pos;
            Sprites = new List<Sprite>();
            Sprite s = MyContent.LoadVehicle(pos);
            if (Math.Abs(Size.X - 0) > 0.01f)
                Size = Size;
            else
            {
                Size = s.Size;
            }
            Sprites.Add(s);
        }

        public bool IsMove
        {
            get { return _isMove; }
            set { _isMove = value; }
        }

        public override void Update(GameTime gameTime)
        {
           if(IsMove)
           {
               Vector2 temp = this.Position;
               temp.X += 5;
               this.Position = temp;
           }
            base.Update(gameTime);
        }
        


    }
}
